package com.buyingtickets.service.impl;

import com.buyingtickets.dao.TypeDao;
import com.buyingtickets.entity.Type;
import com.buyingtickets.service.TypeService;
import org.springframework.stereotype.Service;
import org.springframework.util.StringUtils;

import javax.annotation.Resource;
import java.util.List;
/**
 * @author bwj
 * @date 2021/6/24 9:09
 */
@Service
public class TypeServiceImpl implements TypeService {
    @Resource
    private TypeDao typeDao;

    @Override
    public int queryByClassAndName(String tclass, String tname) {
        if (StringUtils.hasText(tclass) && StringUtils.hasText(tname)) {
            return typeDao.queryByClassAndName(tclass, tname);
        }
        return 0;
    }

    @Override
    public List<Type> queryByCalss(String tclass) {
        if (StringUtils.hasText(tclass)) {
            return typeDao.queryByCalss(tclass);
        }
        return null;
    }
}
